"""
@Author : 合肥一元数智教育科技有限公司
@Date :  2025/2/28 10:57
@Description :   继承细节
1.子类中如何访问父类的成员
   1. 父类属性
   2. 父类的方法
"""


class Aoo:
    public_attribute = 'Aoo public_attribute'

    def public_method(self):
        print('Aoo public_method',self.public_attribute)

class Boo(Aoo):
    public_attribute = 'Boo public_attribute'

    def public_method(self):
        print('Boo public_method',self.public_attribute)

    def visit_parent_attribute(self):
        #  super()
        print(f'visit_parent_attribute = {super().public_attribute}')
        # 类名
        # print(f'visit_parent_attribute = {Aoo.public_attribute}')

    def visit_parent_method(self):
        super().public_method()
        # 类名
        # Aoo.public_method(self)

boo = Boo()
# boo.public_method()
# print(boo.public_attribute)
# boo.visit_parent_attribute()
boo.visit_parent_method()